package day01;

/**
 * @author yangwenqi
 * @decs TODO
 * @date 2025/4/16
 */
//2.封装一个皇帝类，里面有姓名，在位时间，政绩，描述4个属性
// 提供一个方法用来显示所有属性，私有化这些属性并提供对应的get以及set方法
//并在测试类中测试。
public class Emperor {
    private String name;
    private String reignTime;
    private String achievements;
    private String description;

    // 显示所有属性的方法
    public void displayInfo() {
        System.out.println("皇帝信息：");
        System.out.println("姓名：" + name);
        System.out.println("在位时间：" + reignTime);
        System.out.println("主要政绩：" + achievements);
        System.out.println("人物描述：" + description);
    }

    // Getter and Setter 方法
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getReignTime() {
        return reignTime;
    }

    public void setReignTime(String reignTime) {
        this.reignTime = reignTime;
    }

    public String getAchievements() {
        return achievements;
    }

    public void setAchievements(String achievements) {
        this.achievements = achievements;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }
}

